
import UIKit

class XWHomeNoticeView: UIView {
    private var container: UIView!
    
    @IBOutlet weak var XWScrollView: UIScrollView!
    private var XWMessageLabel:UILabel!
    override init(frame: CGRect) {
        super.init(frame: frame)
        showUI()
    }
    
    required init?(coder: NSCoder) {
        super.init(coder: coder)
    }

    @IBAction func XWOkButtonClick(_ sender: UIButton) {
        self.removeFromSuperview()
    }
    
}
extension XWHomeNoticeView{
    private func showUI() {
        container = Bundle.main.loadNibNamed("XWHomeNoticeView", owner: self,options: nil)?.first as? UIView
        container.frame = bounds
        addSubview(container)
        XWMessageLabel = UILabel()
        XWMessageLabel.text = "We collect your device information in order to provide you with the best web experience possible. We need this information to deploy and optimize our servers to ensure that we can provide a high quality service. We conduct general analysis of this information and guarantee the security of the data.In any event, our  VPN services do not sell, use or disclose any data to third parties. Please be sure to read and fully understand the details of this Privacy Policy before use. You can read this Privacy Policy for details. If you agree, please click the button below to start receiving our services."
        XWMessageLabel.font = UIFont.systemFont(ofSize: 15)
        XWMessageLabel.numberOfLines = 0
        XWMessageLabel.frame = CGRectMake(0, 0, XWScrollView.frame.size.width, 300)
        XWMessageLabel.textAlignment = .center
        XWMessageLabel.textColor = kWhiteColor
        XWScrollView.addSubview(XWMessageLabel)
        XWScrollView.contentSize = CGSizeMake(0, 300);
    }
}
